import './assets/main.css'

import {createApp} from 'vue'
import {createRouter, createWebHistory} from 'vue-router'
import App from './App.vue'
import AthleteAnalysis from './views/AthleteAnalysis.vue'
import DataDashboard from './components/DataDashboard.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/data-dashboard'
        },
        {
            path: '/athlete-analysis',
            component: AthleteAnalysis
        },
        {
            path: '/data-dashboard',
            component: DataDashboard
        }
    ]
})

// 项目关闭清除缓存
window.addEventListener('beforeunload', () => {
    localStorage.removeItem('cleaningData');
});

const app = createApp(App)
app.use(router)
app.use(ElementPlus)
app.mount('#app')
